package com.bjx.common.security.util;

import cn.dev33.satoken.stp.StpUtil;
import com.bjx.common.security.domain.LoginUserVO;
import lombok.extern.slf4j.Slf4j;

/**
 * @desc: 用户登录工具类
 * @author: liushuai
 * @date: 2022/12/5 21:32
 */
@Slf4j
public class LoginUtil {

    public static LoginUserVO loginInfo(){
        LoginUserVO loginUserVO = (LoginUserVO)StpUtil.getSession().get("loginUser");
        return loginUserVO;
    }
    public static String getTenantId(){
        LoginUserVO loginUserVO = loginInfo();
        if(loginUserVO == null){
            return null;
        }
        return loginUserVO.getTenantId();
    }
}
